<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/include/include.jsp"%>
<div class="pageContent">
	<form action="<c:if test="${not empty dept}"><c:url value="/dept/edit"/></c:if><c:if test="${empty dept}"><c:url value="/dept/add"/></c:if>" 
		method="post" onsubmit="return validateCallback(this, navTabAjaxDone)">
	<div class="pageFormContent" layoutH="56">
		<p>
			<label><fmt:message key="page.dept.deptcode"/>：</label>			
			<input name="code" type="text" size="30" value="${dept.code}"
			 	<c:if test="${not empty dept}"> readonly="readonly"</c:if> class="required {rangelength:[2,32]}"/>
		</p>
		<p>
			<label><fmt:message key="page.dept.deptname"/>：</label>
			<input name="name" type="text" size="30" value="${dept.name}" class="required"/>
		</p>
		<p>
			<label><fmt:message key="page.dept.address"/>：</label>
			<input name="address" type="text" size="30" value="${dept.address}" class="required"/>
		</p>
		<!-- 根目录不允许有上级机构 -->
		<c:if test="${dept.code ne '0'}">
		<p>
			<label><fmt:message key="page.dept.parentdept"/>：</label>
			<input name="parentDept.code" type="hidden" value="${dept.parentCode}"/>
			<input name="parentDept.name" type="text" size="30" readonly="readonly" class="required" value="${parentName}"/>
			<a class="btnLook" href="<c:url value="/dept/tree/"/>" lookupGroup="parentDept"><fmt:message key="page.dept.chooseparentdept"/></a>	
		</p>	
		</c:if>	
		<p>
			<label><fmt:message key="page.dept.telephone"/>：</label>
			<input name="telephone" type="text" size="30" value="${dept.telephone}"/>
		</p>
		<p>
			<label><fmt:message key="page.dept.fax"/>：</label>
			<input name="fax" type="text" size="30" value="${dept.fax}"/>
		</p>
		
		
	</div>
	
	<div class="formBar">
		<ul>
			<c:if test="${readOnly ne '1'}">
				<youthburin:hasAnyPermissions name="dept:add,dept:edit">
					<!-- 根目录不允许编辑 -->
					<c:if test="${dept.code ne '0'}">
						<li><div class="buttonActive"><div class="buttonContent"><button type="submit"><fmt:message key="page.button.save"/></button></div></div></li>
					</c:if>
					<c:if test="${dept.code eq '0'}">
						<li><fmt:message key="page.dept.rootdeptinfo"/></li>
					</c:if>
				</youthburin:hasAnyPermissions>
			</c:if>
			<li><div class="button"><div class="buttonContent"><button type="button" class="close"><fmt:message key="page.button.cancel"/></button></div></div>	</li>
		</ul>
	</div>
	</form>
</div>